perm filename ROMANL.TMP[CM,DEK] blob
sn#788856 filedate 1985-04-02 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00029 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00003 00002 % Computer Modern Roman lower case:
C00004 00003 cmchar "The letter a"
C00008 00004 cmchar "The letter b"
C00011 00005 cmchar "The letter c"
C00013 00006 cmchar "The letter d"
C00016 00007 cmchar "The letter e"
C00019 00008 cmchar "The letter f"
C00021 00009 iff not variant_g: cmchar "The letter g"
C00025 00010 iff variant_g: cmchar "Variant letter g"
C00029 00011 cmchar "The letter h"
C00031 00012 cmchar "The letter i"
C00033 00013 cmchar "The letter j"
C00036 00014 cmchar "The letter k"
C00040 00015 cmchar "The letter l"
C00041 00016 cmchar "The letter m"
C00044 00017 cmchar "The letter n"
C00046 00018 cmchar "The letter o"
C00047 00019 cmchar "The letter p"
C00050 00020 cmchar "The letter q"
C00053 00021 cmchar "The letter r"
C00055 00022 cmchar "The letter s"
C00059 00023 cmchar "The letter t"
C00062 00024 cmchar "The letter u"
C00065 00025 cmchar "The letter v"
C00068 00026 cmchar "The letter w"
C00072 00027 cmchar "The letter x"
C00075 00028 cmchar "The letter y"
C00079 00029 cmchar "The letter z"
C00081 ENDMK
C⊗;
% Computer Modern Roman lower case:
% These letters were originally coded by D. E. Knuth in November, 1979,
% inspired by the Monotype alphabets used in {\sl The Art of Computer Programming}.
% Sans serif designs by Richard Southall were added in April, 1982.
% The programs were revised for the new \MF\ conventions in 1985.
% Character codes \0141 through \0172 are generated.
cmchar "The letter a";
beginchar("a",9u#,x_height#,0);
italcorr 1/3[bar_height#,x_height#]*slant+.5stem#-serif_fit#-2u#;
adjust_fit(0,serif_fit#);
pickup teeny_pen; top y3r=h+round 1.5oo;
if serifs: penpos1(flare-teeny,180); penpos2(hair-teeny,180);
penpos3(vair-teeny,90); lft x1r=round 1.25u; x3=.5w-.5u;
y1=min(bar_height+.5flare+2vair+2,.9[bar_height,h]-.5flare);
bulb(3,2,1); % bulb
else: penpos1(5/7[vair,flare]-teeny,95); x1l=good.x 1.5u; x1r:=good.x x1r;
penpos3(1/8[vair,teeny_breadth]-teeny,90);
x3=.5w-.2u; top y1r=round(.8[bar_height+teeny,top y3r]);
filldraw stroke z1e..tension 1 and .9..{right}z3e; fi % terminal
penpos4(stem-teeny,0); rt x4r=round(w-2.5u+.5stem); y4=1/3[bar_height,h];
penpos5(stem-teeny,0); x5=x4; y5=.55bar_height;
filldraw stroke super_arc.e(3,4)&z4e..z5e; % arc and stem
penpos10(.3[teeny_breadth,vair]-teeny,90); x10=x4; bot y10=bar_height;
penpos11(round(curve-2stem_corr)-teeny,180);
lft x11r=round max(.5u,1.5u-.5curve); y11=1/3[top y12l,top y10r];
penpos12(vair-teeny,270); x12l=.5w-.75u; bot y12r=-oo;
penpos13(3epsilon,360); z13l=z5l;
(x,y12r)=whatever[z12l,z13l]; x12r:=x;
{{interim superness:=more_super;
filldraw stroke z13e{down}...z12e{left}...{up}z11e&super_arc.e(11,10)}}; % bowl
if serifs: numeric shaved_stem; shaved_stem=round(stem-3stem_corr);
if hair#+.5stem#>1.5u#: pickup tiny_pen;
penpos5'(shaved_stem-tiny,0); rt x5'r=x5r+pen_rt_[teeny_pen]; y5'=y5;
penpos6(shaved_stem-tiny,0); x6=x5'; y6=.2[.5tiny,bar_height];
penpos7(shaved_stem-tiny,0); rt x7r=round(w-.25u); bot y7=0;
filldraw stroke z5'e---z6e...z7e{right}; % foot
else: pickup crisp_pen;
penpos5'(shaved_stem-crisp,0); rt x5'r=x5r+pen_rt_[teeny_pen]; y5'=y5;
penpos6(shaved_stem-crisp,0); x6=x5'; y6=1/3bar_height;
penpos7(.2[vair,stem]-crisp,90); x7r=.5[x6r,x8r]; bot y7l=-round .5oo;
penpos8(hair-crisp,180); rt x8l=round(w-.1u); y8=y6;
penpos9(hair-crisp,180); x9=x8; top y9=round .6bar_height;
(x',y7l)=whatever[z7r,z8r]; x7l:=x';
filldraw stroke z5'e---z6e...z7e{right}...z8e---z9e; fi % hook
else: numeric shaved_stem; shaved_stem=round(stem-stem_corr); pickup tiny_pen;
penpos5'(shaved_stem-tiny,0); rt x5'r=x5r+pen_rt_[teeny_pen]; y5'=y5;
penpos6(shaved_stem-tiny,0); x6=x5'; bot y6=0;
filldraw stroke z5'e--z6e; fi % base of stem
penlabels(1,2,3,4,5,6,7,8,9,10,11,12,13); endchar;
cmchar "The letter b";
beginchar("b",10u#+serif_fit#,asc_height#,0);
italcorr .5x_height#*slant+min(.5curve#-u#,-.25u#);
adjust_fit(serif_fit#,0);
pickup tiny_pen; penpos1(stem'-tiny,0); penpos2(stem-tiny,0);
penpos0'(stem'-tiny,0); penpos0(stem-tiny,0); z0l=z0'l; x0'=x1; x0=x2;
lft x1l=round(2.5u-.5stem'); top y1=h;
numeric stem_edge; stem_edge=rt x2r;
pickup teeny_pen; penpos3(if notched:3epsilon else: hair-teeny fi,180);
penpos4(vair-teeny,90); penpos5(curve-teeny,0);
penpos6(vair-teeny,-90); penpos7(x3l-x3r,-180);
rt x3l=1/3[rt x2,stem_edge]; y3=1/8[bar_height,x_height];
x4l=w-4.5u; top y4r=x_height+oo;
rt x5r=round min(w-1.35u+.5curve,w-.6u); y5=.5x_height;
x6l=x4l-.2u; bot y6r=-oo;
x7=x3; y7=min(y3,y6+y4-y3+.6vair);
(x,y4r)=whatever[z3l,z4l]; x4r:=x;
(x',y6r)=whatever[z7l,z6l]; x6r:=x';
filldraw stroke z3e{up}...{right}z4e&pulled_super_arc.e(4,5)(superpull)
&pulled_super_arc.e(5,6)(superpull)&z6e{left}...{up}z7e; % bowl
y0=ypart(((stem_edge,h)..(stem_edge,0))intersectionpoint(z3l{up}...{right}z4l));
y2=ypart(((stem_edge,h)..(stem_edge,0))intersectionpoint(z6l{left}...{up}z7l));
pickup tiny_pen; filldraw stroke z1e--z0'e--z0e--z2e; % stem
pickup crisp_pen; penpos8(hair-crisp,0); penpos7'(stem-crisp,0);
z7'=z2; x8l=x7'l; bot y8=0;
filldraw stroke z7'e--z8e; % point
if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); fi % upper serif
penlabels(0,1,2,3,4,5,6,7,8); endchar;
cmchar "The letter c";
beginchar("c",8u#,x_height#,0);
italcorr x_height#*slant-.5u#;
adjust_fit(if monospace: .5u#,.5u# else: 0,0 fi);
pickup teeny_pen; penpos2(vair-fine,90); penpos4(vair-fine,270);
x2=x4=.5(w+u); top y2r=round(h+1.5oo); bot y4r=-oo;
penpos3(curve-fine,180); lft x3r=round max(.5u,1.25u-.5curve); y3=.5h;
if serifs: penpos1(hair-fine,0); penpos0(flare-fine,0);
y1=min(bar_height+.5flare+2vair+2,.9[bar_height,h]-.5flare);
rt x1r=round(w-1.1u); bulb(2,1,0); % bulb
penpos5(hair-fine,0); rt x5r=round(w-2/3u); y5=good.y(.5bar_height-.9);
(x,y4l)=whatever[z4r,z5l]; x4l:=x;
else: penpos1(5/7[vair,flare]-fine,90);
rt x1=round(w-u); top y1r=round(.8[bar_height+fine,x_height+oo]);
filldraw stroke z1e..tension 1 and .9..{left}z2e; % upper terminal
penpos5(.6[vair,flare]-fine,265); rt x5l=round(w-.6u);
y5r=good.y(y5r+1/3bar_height-y5); y5l:=good.y y5l; x5r:=good.x x5r; fi
filldraw stroke super_arc.e(2,3) & super_arc.e(3,4)
& z4e{right}..tension .9 and 1..z5e; % arc and lower terminal
penlabels(0,1,2,3,4,5); endchar;
cmchar "The letter d";
beginchar("d",10u#+serif_fit#,asc_height#,0);
italcorr asc_height#*slant-serif_fit#+.5stem#-2u#;
adjust_fit(0,serif_fit#);
pickup tiny_pen; penpos1(stem'-tiny,0); penpos2(stem-tiny,0);
penpos0'(stem'-tiny,0); penpos0(stem-tiny,0); z0r=z0'r; x0'=x1; x0=x2;
rt x1r=round(w-2.5u+.5stem'); top y1=h;
numeric stem_edge; stem_edge=lft x2l;
pickup fine_pen; penpos3(if notched:3epsilon else: hair-fine fi,0);
penpos4(vair-fine,90); penpos5(curve-fine,180);
penpos6(vair-fine,270); penpos7(x3r-x3l,360);
lft x3l=1/3[lft x2,stem_edge]; y3=1/8[bar_height,x_height];
x4l=4.7u; top y4r=x_height+oo;
lft x5r=round max(1.35u-.5curve,.6u); y5=.5x_height;
x6l=x4l-.2u; bot y6r=-oo;
x7=x3; y7=min(y3,y6+y4-y3+.6vair);
(x,y4r)=whatever[z3l,z4l]; x4r:=x;
(x',y6r)=whatever[z7l,z6l]; x6r:=x';
filldraw stroke z3e{up}...{left}z4e&pulled_super_arc.e(4,5)(superpull)
&pulled_super_arc.e(5,6)(superpull)&z6e{right}...{up}z7e; % bowl
y0=ypart(((stem_edge,h)..(stem_edge,0))intersectionpoint(z3l{up}...{left}z4l));
pickup tiny_pen; bot y2=if serifs:-min(oo,serif_drop) else: 0 fi;
filldraw stroke z1e--z0'e--z0e--z2e; % stem
if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); % upper serif
sloped_serif.r(2,0,b,1/3,jut,min(oo,serif_drop)); fi % lower serif
penlabels(0,1,2,3,4,5,6,7); endchar;
cmchar "The letter e";
beginchar("e",8u#,x_height#,0);
italcorr .5[bar_height#,x_height#]*slant+.5min(curve#-1.5u#,0);
adjust_fit(if monospace: .5u#,.5u# else: 0,0 fi);
numeric left_curve,right_curve,short_terminal;
left_curve=right_curve+5stem_corr=curve if not serifs: -3stem_corr fi;
if right_curve<tiny_breadth: right_curve:=tiny_breadth; fi
if left_curve<tiny_breadth: left_curve:=tiny_breadth; fi
penpos1(right_curve-tiny,0); penpos2(vair-tiny,90);
penpos3(left_curve-tiny,180); pickup tiny_pen;
y1=good.y bar_height; top y2r=h+round 1.5oo; y0l=bot y1;
rt x1r=round min(w-.5u,w-u+.5right_curve);
lft x3r=round max(.5u,1.25u-.5left_curve); x2=.55[x3,x1];
{{interim superness:=more_super;
filldraw stroke super_arc.e(1,2)}}; % right bowl
y3=.5[y2,y4]; bot y4r=-oo; x4=x2+.25u;
if serifs: penpos4(vair+hair_corr-tiny,270); penpos5(hair-tiny,360);
y5=good.y(.5bar_height-.9); x5r=x1r;
(x,y4l)=whatever[z4r,z5]; x4l:=x;
filldraw stroke super_arc.e(2,3) & super_arc.e(3,4)
..z5e; % left bowl, arc, and terminal
else: penpos4(vair-tiny,270);
filldraw stroke super_arc.e(2,3) & super_arc.e(3,4); % left bowl and arc
penpos4'(vair-fine,270); z4=z4'; pickup fine_pen;
% short_terminal=.5[vair,flare]; top y5l=vround(1/3bar_height+.5short_terminal);
% y5l-y5r=short_terminal-fine; rt x5l=round(w-.6u); x5r=good.x(x5l-.1u);
penpos5(.5[vair,flare]-fine,265); rt x5l=round(w-.6u);
y5r=good.y(y5r+1/3bar_height-y5); y5l:=good.y y5l; x5r:=good.x x5r;
filldraw stroke z4'e{right}..z5e; fi % terminal
path testpath; testpath=super_arc.l(2,3) & super_arc.l(3,4);
y1'r=y0r=y0l+.6[fine,vair]; y1'l=y0l; x1'l=x1'r=x1;
forsuffixes $=l,r: x0$=1+xpart
(((0,y0$)--(x1,y0$)) intersectionpoint testpath); endfor
fill stroke z0e--z1'e; % crossbar
penlabels(0,1,2,3,4,5); endchar;
cmchar "The letter f";
beginchar("f",5.5u#,asc_height#,0);
italcorr asc_height#*slant+if serifs:flare#-.25u# else: 1.25u# fi;
adjust_fit(0,if monospace: .5u# else: 0 fi);
pickup tiny_pen; penpos1(stem'-tiny,0); lft x1l=round(2.5u-.5stem');
numeric bar_thickness, bulb_diam;
if serifs: bulb_diam=round(.8[stem,flare]); bar_thickness=slab;
penpos2(bulb_diam-fine,0); y2+.5bulb_diam=.9[x_height,h+oo];
if monospace: rt x2r=round(w-.5u) else: lft x2l=round(w-.75u+.5) fi;
else: pickup fine_pen; bar_thickness=vair;
penpos2(5/7[vair,flare]-fine,90); top y2r=h;
rt x2=round(if monospace:w-.5u else:w+.75u fi); fi
f_stroke(1,2,a,b,c,jut,if not monospace:1.25fi jut); % stem, arc, terminal, serif
pickup crisp_pen; top y3r=top y4r=x_height; lft x3=round(.5u)-1;
penpos3(bar_thickness-crisp,90); penpos4(bar_thickness-crisp,90);
rt x4=round(w-if monospace:.75 else:1/3 fi u);
filldraw stroke z3e..z4e; % bar
penlabels(1,2,3,4); endchar;
iff not variant_g: cmchar "The letter g";
beginchar("g",9u#,x_height#,desc_depth#);
italcorr x_height#*slant+.25u#;
adjust_fit(0,0);
numeric reduced_vair,reduced_curve,loop_top,loop_side;
reduced_vair=round(.5[fine_breadth,vair]+hair_corr);
reduced_curve=round(curve-3stem_corr);
if reduced_curve<fine_breadth: right_curve:=fine_breadth; fi
loop_top=round(.77[vair,fudged.stem]);
loop_side=round(.64[vair,fudged.stem]);
pickup fine_pen; penpos1(reduced_vair-fine,90); penpos2(reduced_curve-fine,180);
penpos3(reduced_vair-fine,270); penpos4(reduced_curve-fine,360);
penpos11(loop_top-fine,90); y11r=good.y(y11r+.15bar_height-y11);
x1=x3=.5[x2,x4]; y2=y4=.5[y1,y3];
lft x2r=round(1.75u-.5reduced_curve); rt x4r=round(w-2.75u+.5reduced_curve);
top y1r=h+oo; y3r=good.y(y3r+.27[top y11r,bot y1l]-y3);
filldraw stroke pulled_super_arc.e(1,2)(superpull)
& pulled_super_arc.e(2,3)(superpull); % left half of bowl
filldraw stroke pulled_super_arc.e(3,4)(superpull)
& pulled_super_arc.e(4,1)(superpull); % right half of bowl
x0=superness[x1r,x4r]; y0=superness[y4r,y1r]; % NE point on the super bowl
x8'=superness[x3r,x2r]; y8'=superness[y2r,y3r]; % SW point on the super bowl
x8''=superness[x3,x2]; y8''=superness[y2,y3];
penpos0(vair-fine,angle(z0-z8')+90);
penpos8(3epsilon,angle(z0-z8')-90); z8=.618[z8',z8''];
if serifs: penpos5(vair-fine,90);
penpos6(hair-fine,0); penpos7(.5[hair,flare]-fine,0);
x5=.75[x0,x6]; top y5r=h+o;
rt x6r=round(w-.25u); y6+(.5[hair,flare])/2=.95[bar_height,h]+oo;
filldraw stroke z0e..{right}z5e; bulb(5,6,7); % ear
else: penpos5(vair+hair_corr-fine,100); top y5r=h+oo;
rt x5l=round(w-.25u); y5l:=good.y y5l;
filldraw z0{z5-z0}..z5l--z5r{left}..{curl 1}cycle; fi % ear
penpos10(loop_top-fine,90); x10=x8+.75u; y10=y11;
penpos12(loop_side-fine,0); penpos13(reduced_vair-fine,-90);
penpos14(loop_side-fine,-180); penpos10'(.5[fine_breadth,vair]-fine,-270);
rt x12r=round max(w-1.25u+.5loop_side,w-.5u); y12=y14=.5[y11,y13];
x11=x13=.5w; bot y13r=-d-oo; x14=w-x12; z10'l=z10l;
filldraw stroke z8e{z8-z0}..z10e---z11e; % link
filldraw stroke {{interim superness:=hein_super; super_arc.e(11,12)}}
& super_arc.e(12,13) & super_arc.e(13,14) & super_arc.e(14,10'); % loop
penlabels(1,2,3,4,5,6,7,8,10,11,12,13,14); labels(8',8''); endchar;
iff variant_g: cmchar "Variant letter g";
beginchar("g",10u#+serif_fit#,x_height#,desc_depth#);
italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
adjust_fit(0,serif_fit# if serifs: -.5u# fi);
pickup tiny_pen; penpos1(stem'-tiny,0); penpos2(stem-tiny,0);
penpos0'(stem'-tiny,0); penpos0(stem-tiny,0); z0r=z0'r; x0'=x1; x0=x2;
rt x1r=round(w-2.5u+.5stem');
numeric stem_edge; stem_edge=lft x2l;
pickup fine_pen; penpos3(if notched:3epsilon else: hair-fine fi,0);
penpos4(vair-fine,90); penpos5(curve-fine,180);
penpos6(vair-fine,270); penpos7(x3r-x3l,360);
lft x3l=2/3[lft x2,stem_edge]; y3=bar_height;
x4l=4.7u; top y4r=x_height+oo;
lft x5r=round max(1.35u-.5curve,.6u); y5=.5x_height;
x6l=x4l-.2u; bot y6r=-oo;
lft x7l=1/3[lft x2,stem_edge]; y7=min(y3,y6+y4-y3+.6vair);
(x,y4r)=whatever[z3l,z4l]; x4r:=x;
(x',y6r)=whatever[z7l,z6l]; x6r:=x';
filldraw stroke z3e{up}...{left}z4e&super_arc.e(4,5)
&super_arc.e(5,6)&z6e{right}...{up}z7e; % bowl
y1=ypart(((stem_edge,h)..(stem_edge,0))intersectionpoint(z3l{up}...{left}z4l));
y0=ypart(((stem_edge,h)..(stem_edge,0))intersectionpoint(z6l{right}...{up}z7l));
pickup tiny_pen; bot y2=if serifs: -.25d else: 0 fi;
filldraw stroke z1e--z0'e--z0e--z2e; % stem
pickup crisp_pen;
penpos8(round(hair-stem_corr)-crisp,0); penpos7'(stem'-crisp,0);
z7'=z1; x8r=x7'r; top y8=h+oo;
filldraw stroke z7'e--z8e; % point
if serifs: pickup tiny_pen;
penpos9(vair-tiny,-90); x9=.5[x2,x10]; bot y9r=-d-oo;
penpos10(hair-tiny,-180); lft x10r=round u; y10=-.75d+.5flare;
penpos11(flare-tiny,-180); z11r=z10r;
bulb(9,10,11); filldraw stroke super_arc.e(2,9); % tail
else: pickup fine_pen; penpos2'(stem-fine,0); z2'=z2;
z2''r=z2'r; z2''=z2'; z2''l=(x2'l,0);
penpos9(vair-fine,-90); x9=4.5u; bot y9r=-d-oo;
penpos10(.5[vair,flare]-fine,-90); lft x10=round 1.25u;
y10r=good.y(-5/6d); y10l:=good.y y10l;
filldraw stroke z2'e..z2''e&super_arc.e(2'',9)
& z9e{left}..tension .9 and 1..z10e; fi % tail
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;
cmchar "The letter h";
beginchar("h",10u#,asc_height#,0);
italcorr .5[bar_height#,x_height#]*slant-serif_fit#+.5stem#-2u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny_pen; penpos1(stem-tiny,0); penpos2(stem-tiny,0);
penpos1'(stem'-tiny,0); penpos2'(stem'-tiny,0); penpos3(stem-tiny,0);
lft x1l=round(2.5u-.5stem); x1l=x1'l=x2l=x2'l; x3=w-x1;
top y1=h; bot y2=0; y1=y1'; y2=y2';
filldraw stroke z1'e..z2'e; % left stem
h_stroke(2,a,3,4); % arch and right stem
if serifs: sloped_serif.l(1',2',b,1/3,jut,serif_drop); % upper left serif
numeric inner_jut; pickup tiny_pen;
if rt x2r+jut+u+2≤lft x4l-jut: inner_jut=jut;
else: rt x2r+inner_jut+u+2=lft x4l-inner_jut; fi
cup_serif(2,1,c,d,1/3,jut,1/3,inner_jut); % lower left serif
cup_serif(4,3,e,f,1/3,inner_jut,1/3,jut); fi % lower right serif
penlabels(1,2,3,4); endchar;
cmchar "The letter i";
beginchar("i",5u#,asc_height#,0);
numeric dot_diam#; dot_diam#=max(dotsize#,cap_curve#);
define_whole_blacker_pixels(dot_diam);
italcorr min(2x_height#,asc_height#)*slant-serif_fit#
+ .5 if serifs: stem# else: dot_diam# fi -2u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny_pen; penpos1(stem''-tiny,0); penpos2(stem''-tiny,0);
lft x1l=round(2.5u-.5stem''); x1=x2;
top y1=x_height if serifs: +min(oo,serif_drop) fi; bot y2=0;
filldraw stroke z1e--z2e; % stem
penpos3(dot_diam-tiny,0); penpos4(dot_diam-tiny,90);
if serifs: x3r=x1r else: x3=x1-.5 fi;
top y4r=min(2x_height,h+1);
if bot y4l-top y1<tiny: y4l:=min(y4r-2epsilon,y1+2tiny); fi
x3=x4; y3=.5[y4l,y4r]; dot(3,4); % dot
if serifs: sloped_serif.l(1,2,a,1/3,.95jut,serif_drop); % upper serif
cup_serif(2,1,b,c,1/3,jut,1/3,.9jut); fi % lower serif
penlabels(1,2,3,4); endchar;
cmchar "The letter j";
beginchar("j",5.5u#,asc_height#,desc_depth#);
numeric dot_diam#; dot_diam#=max(dotsize#,cap_curve#);
define_whole_blacker_pixels(dot_diam);
italcorr min(2x_height#,asc_height#)*slant-serif_fit#+.5stem#-2u#;
adjust_fit(serif_fit# if monospace:+u# fi,serif_fit#);
pickup tiny_pen; penpos1(stem''-tiny,0); penpos2(stem''-tiny,0);
rt x1r=round(w-2.5u+.5stem''); x1=x2;
top y1=x_height if serifs: +min(oo,serif_drop) fi; bot y2=-1/3d;
filldraw stroke z1e--z2e; % stem
penpos3(dot_diam-tiny,0); penpos4(dot_diam-tiny,90);
x3r=x1r; top y4r=min(2x_height,h+1);
if bot y4l-top y1<tiny: y4l:=min(y4r-2epsilon,y1+2tiny); fi
x3=x4; y3=.5[y4l,y4r]; dot(3,4); % dot
if serifs: sloped_serif.l(1,2,a,1/3,.95jut,serif_drop); % upper serif
penpos5(vair-tiny,-90); penpos6(hair-tiny,-180); penpos7(flare-tiny,-180);
pickup tiny_pen; x5=.5[x2,x6r]; bot y5r=-d-oo; y6-.5flare=-.88d;
if monospace: lft x6r=0 else: z6r=z7r; rt x7l=floor .75u fi;
(x,y5r)=whatever[z5l,z4l]; x5r:=x;
filldraw stroke z2e{down}...z5e{left}; bulb(5,6,7); % arc and bulb
else: pickup fine_pen; penpos2'(stem''-fine,0); z2'=z2;
penpos6(.2[vair,stem'']-fine,-90); penpos7(vair-fine,-90);
lft x7r=round(-.75u); bot y7r=round 5/6(-d-oo);
(x,y7l)=whatever[z7r,z3]; x7l:=x;
z5r=z2'r; (x2'l,y5l)=whatever[z7l,z5r]; x5l=x2'l; y5=y5r;
x6r=.5[x7r,x5r]; x6l:=.5[x7l,x5l]; bot y6r=-d-oo;
filldraw stroke z2'e..{down}z5e & super_arc.e(5,6)
& z6e{left}..z7e; fi % arc and terminal
penlabels(1,2,3,4,5,6,7); endchar;
cmchar "The letter k";
beginchar("k",9.5u#,asc_height#,0);
italcorr x_height#*slant-.2u#;
adjust_fit(serif_fit#,serif_fit#);
numeric right_jut,stem[],alpha[];
stem1=round(fudged.stem-stem_corr);
stem2=round(fudged.stem-2stem_corr);
if serifs: right_jut=.8jut;
else: right_jut=.4tiny; fi
penpos1(stem1-tiny,0); penpos2(stem2-tiny,0);
pickup tiny_pen; top y1=h; bot y2=0;
lft x1l=lft x2l=round(2.5u-.5stem1);
top y3=x_height; rt x3r=round(r-letter_fit-.7u-right_jut);
bot y6=0; rt x6r=round(r-letter_fit-.3u-right_jut);
x4=x11=x1; y4=.7bar_height; y11=y3;
alpha1=diag_ratio(1,.5(fudged.hair-tiny),y3-y4,x3r-x4);
penpos3(alpha1*(fudged.hair-tiny),0); penpos4(whatever,-90);
alpha2=diag_ratio(1,.5(fudged.stem-tiny),y1-y6,x6r-x1);
penpos6(alpha2*(fudged.stem-tiny),0);
forsuffixes $=l,r: y3'$=x_height; y6'$=0; z4$=z3'$+whatever*(z3-z4);
z5$=z6'$+whatever*(z11-z6)=whatever[z3,z4]; endfor
z5=.5[z5l,z5r];
z3'r=z3r+penoffset z3-z4 of currentpen+whatever*(z3-z4);
% z3'l=z3l+penoffset z4-z3 of currentpen+whatever*(z3-z4);
% previous equation is implied, since z4=.5[z4l,z4r]
z6'r=z6r+penoffset z11-z6 of currentpen+whatever*(z11-z6);
z6'l=z6l+penoffset z6-z11 of currentpen+whatever*(z11-z6);
fill z4r--diag_end(4r,3'r,3'l,4l)--z4l--cycle; % upper diagonal
fill z5l--diag_end(5l,6'l,6'r,5r)--z5r--cycle; % lower diagonal
penpos0(stem1-tiny,0); penpos0'(stem2-tiny,0); y0=y0'; x0=x1; x0'=x2;
rt z0r=whatever[z3,z4]; filldraw stroke z1e..z0e--z0'e..z2e; % stem
if serifs: numeric inner_jut;
if rt x2r+jut+u+2≤lft x6l-jut: inner_jut=jut;
else: rt x2r+inner_jut+u+2=lft x6l-inner_jut; fi
sloped_serif.l(1,0,a,1/3,jut,serif_drop); % upper stem serif
cup_serif(2,1,b,c,1/3,jut,1/3,inner_jut); % lower stem serif
cup_serif(3,4,d,e,2/3,1.2jut,1/2,right_jut)(dark); % upper diagonal serif
cup_serif(6,5,f,g,1/2,inner_jut,1/3,right_jut)(dark); fi % lower diagonal serif
penlabels(0,1,2,3,4,5,6); endchar;
cmchar "The letter l";
beginchar("l",5u#,asc_height#,0);
italcorr asc_height#*slant-serif_fit#+.5stem#-2u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny_pen; penpos1(stem'-tiny,0); penpos2(stem'-tiny,0);
lft x1l=round(2.5u-.5stem'); x1=x2; top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
if serifs: sloped_serif.l(1,2,a,1/3,jut,serif_drop); % upper serif
cup_serif(2,1,b,c,1/3,jut,1/3,jut); fi % lower serif
penlabels(1,2); endchar;
cmchar "The letter m";
beginchar("m",15u#,x_height#,0);
italcorr .5[bar_height#,x_height#]*slant-serif_fit#+.5stem#-2u#;
adjust_fit(serif_fit#,serif_fit#);
numeric shaved_stem; shaved_stem=round(mfudged.stem-2stem_corr);
pickup tiny_pen; penpos1(mfudged.stem-tiny,0); penpos2(mfudged.stem-tiny,0);
penpos1'(shaved_stem-tiny,0); penpos2'(shaved_stem-tiny,0);
penpos3(mfudged.stem-tiny,0); penpos5(mfudged.stem-tiny,0);
lft x1l=round(2.5u-.5stem); x1l=x1'l=x2l=x2'l;
lft x3l=round(.5w-.5stem); x5-x3=x3-x1;
if not monospace: r:=x5+x1-l; fi % change width for better fit
top y1=h+min(oo,serif_drop); bot y2=0; y1=y1'; y2=y2';
filldraw stroke z1'e..z2'e; % left stem
h_stroke(2,a,3,4); % left arch and middle stem
h_stroke(4,b,5,6); % right arch and right stem
if serifs: sloped_serif.l(1',2',c,1/3,jut,serif_drop); % upper left serif
numeric inner_jut; pickup tiny_pen;
if rt x2r+jut+u+2≤lft x4l-jut: inner_jut=jut;
else: rt x2r+inner_jut+u+2=lft x4l-inner_jut; fi
cup_serif(2,1,d,e,1/3,jut,1/3,inner_jut); % lower left serif
cup_serif(4,3,f,g,1/3,inner_jut,1/3,inner_jut); % lower middle serif
cup_serif(6,5,h,i,1/3,inner_jut,1/3,jut); fi % lower right serif
penlabels(1,2,3,4,5,6); endchar;
cmchar "The letter n";
beginchar("n",10u#,x_height#,0);
italcorr .5[bar_height#,x_height#]*slant-serif_fit#+.5stem#-2u#;
adjust_fit(serif_fit#,serif_fit#);
pickup tiny_pen; penpos1(stem-tiny,0); penpos2(stem-tiny,0);
penpos1'(stem''-tiny,0); penpos2'(stem''-tiny,0); penpos3(stem-tiny,0);
lft x1l=round(2.5u-.5stem); x1l=x1'l=x2l=x2'l; x3=w-x1;
top y1=h+min(oo,serif_drop); bot y2=0; y1=y1'; y2=y2';
filldraw stroke z1'e..z2'e; % left stem
h_stroke(2,a,3,4); % arch and right stem
if serifs: sloped_serif.l(1',2',b,1/3,jut,serif_drop); % upper left serif
numeric inner_jut; pickup tiny_pen;
if rt x2r+jut+u+2≤lft x4l-jut: inner_jut=jut;
else: rt x2r+inner_jut+u+2=lft x4l-inner_jut; fi
cup_serif(2,1,c,d,1/3,jut,1/3,inner_jut); % lower left serif
cup_serif(4,3,e,f,1/3,inner_jut,1/3,jut); fi % lower right serif
penlabels(1,2,3,4); endchar;
cmchar "The letter o";
beginchar("o",9u#,x_height#,0);
italcorr .7x_height#*slant;
adjust_fit(if monospace: .5u#,.5u# else: 0,0 fi);
penpos1(vair,90); penpos3(round(vair+hair_corr),-90);
penpos2(curve,180); penpos4(curve,0);
x2r=round max(.5u,1.25u-.5curve);
x4r=w-x2r; x1=x3=.5w; y1r=h+round 1.5oo; y2=y4=.5h-hair_corr; y3r=-oo;
penstroke pulled_super_arc.e(1,2)(superpull)
& pulled_super_arc.e(2,3)(superpull)
& pulled_super_arc.e(3,4)(superpull)
& pulled_super_arc.e(4,1)(superpull) & cycle; % bowl
penlabels(1,2,3,4); endchar;
cmchar "The letter p";
beginchar("p",10u#+serif_fit#,x_height#,desc_depth#);
italcorr .5x_height#*slant+min(.5curve#-.85u#,-.1u#);
adjust_fit(serif_fit#,0);
pickup tiny_pen; penpos1(stem'-tiny,0); penpos2(stem-tiny,0);
penpos0'(stem'-tiny,0); penpos0(stem-tiny,0); z0l=z0'l; x0'=x1; x0=x2;
lft x1l=round(2.5u-.5stem'); top y1=h if serifs: +min(oo,serif_drop) fi;
numeric stem_edge; stem_edge=rt x2r;
pickup fine_pen; penpos3(if notched:3epsilon else: hair-fine fi,180);
penpos4(vair+round hair_corr-fine,90); penpos5(curve-fine,0);
penpos6(vair-fine,-90); penpos7(x3l-x3r,-180);
rt x3l=1/3[rt x2,stem_edge]; y3=1/8[bar_height,x_height];
x4l=w-4.5u; top y4r=x_height+oo;
rt x5r=round min(w-1.35u+.5curve,w-.6u); y5=.5x_height;
x6l=x4l-.2u; bot y6r=-oo;
x7=x3; y7=min(y3,y6+y4-y3+.6vair);
(x,y4r)=whatever[z3l,z4l]; x4r:=x;
(x',y6r)=whatever[z7l,z6l]; x6r:=x';
filldraw stroke z3e{up}...{right}z4e&super_arc.e(4,5)
&super_arc.e(5,6)&z6e{left}...{up}z7e; % bowl
y0=ypart(((stem_edge,h)..(stem_edge,0))intersectionpoint(z3l{up}...{right}z4l));
pickup tiny_pen; bot y2=-d;
filldraw stroke z1e--z0'e--z0e--z2e; % stem
pickup crisp_pen; penpos8(hair-crisp,0); penpos7'(stem-crisp,0);
z7'=z2; x8l=x7'l; bot y8=0;
filldraw stroke z7'e--z8e; % point
if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); % upper serif
cup_serif(2,0,b,c,1/3,jut,1/3,jut); fi % lower serif
penlabels(0,1,2,3,4,5,6,7,8); endchar;
cmchar "The letter q";
beginchar("q",10u#+serif_fit#,x_height#,desc_depth#);
italcorr x_height#*slant-serif_fit#+.5stem#-2u# if serifs:+.5u# fi;
adjust_fit(0,serif_fit# if serifs: -.5u# fi);
pickup tiny_pen; penpos1(stem'-tiny,0); penpos2(stem-tiny,0);
penpos0'(stem'-tiny,0); penpos0(stem-tiny,0); z0r=z0'r; x0'=x1; x0=x2;
rt x1r=round(w-2.5u+.5stem');
numeric stem_edge; stem_edge=lft x2l;
pickup fine_pen; penpos3(if notched:3epsilon else: hair-fine fi,0);
penpos4(vair+round hair_corr-fine,90); penpos5(curve-fine,180);
penpos6(vair-fine,270); penpos7(x3r-x3l,360);
lft x3l=2/3[lft x2,stem_edge]; y3=bar_height;
x4l=4.7u; top y4r=x_height+oo;
lft x5r=round max(1.35u-.5curve,.6u); y5=.5x_height;
x6l=x4l-.2u; bot y6r=-oo;
lft x7l=1/3[lft x2,stem_edge]; y7=min(y3,y6+y4-y3+.6vair);
(x,y4r)=whatever[z3l,z4l]; x4r:=x;
(x',y6r)=whatever[z7l,z6l]; x6r:=x';
filldraw stroke z3e{up}...{left}z4e&super_arc.e(4,5)
&super_arc.e(5,6)&z6e{right}...{up}z7e; % bowl
y1=ypart(((stem_edge,h)..(stem_edge,0))intersectionpoint(z3l{up}...{left}z4l));
y0=ypart(((stem_edge,h)..(stem_edge,0))intersectionpoint(z6l{right}...{up}z7l));
pickup tiny_pen; bot y2=-d;
filldraw stroke z1e--z0'e--z0e--z2e; % stem
pickup crisp_pen;
penpos8(round(hair-stem_corr)-crisp,0); penpos7'(stem'-crisp,0);
z7'=z1; x8r=x7'r; top y8=h+oo;
filldraw stroke z7'e--z8e; % point
if serifs: cup_serif(2,0,b,c,1/3,jut,1/3,jut); fi % lower serif
penlabels(0,1,2,3,4,5,6,7,8); endchar;
cmchar "The letter r";
numeric r_flare#; r_flare#=.75[if serifs: stem# else: vair# fi,flare#];
define_whole_blacker_pixels(r_flare);
beginchar("r",if serifs:max(7u#,5.5u#+r_flare#) else:6.5u# fi,x_height#,0);
italcorr x_height#*slant if not serifs: +.25u# fi;
adjust_fit(serif_fit#,0);
pickup fine_pen; top y4r=h+oo;
if serifs: penpos4(vair-fine,90); penpos5(hair-fine,0); penpos6(r_flare-fine,0);
x4=5.25u; rt x5r=round(w-.5u+.5); y5+.5r_flare=.9[bar_height,h]+oo;
bulb(4,5,6); % bulb
else: penpos4(r_flare-fine,90); rt x4=round(w-.25u); fi
penpos3(2epsilon,180); rt x3l=round(2.5u-.5stem')+stem'; top y3=bar_height;
filldraw stroke z3e{up}..{right}z4e; % arc
pickup tiny_pen; penpos0(stem'-tiny,0); penpos2(stem'-tiny,0);
penpos1(round(stem-3stem_corr)-tiny,0); top y1=h+min(oo,serif_drop);
penpos0'(round(stem-3stem_corr)-tiny,0); y0=y0'=y3; x1l=x0l=x0'l=x2l;
lft x1l=round(2.5u-.5stem'); bot y2=0;
filldraw stroke z1e--z0'e--z0e--z2e; % stem
if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); % upper serif
cup_serif(2,0,b,c,1/3,jut,1/3,1.25jut); fi % lower serif
penlabels(1,2,3,4,5,6); endchar;
cmchar "The letter s";
beginchar("s",7.1u#,x_height#,0);
italcorr x_height#*slant-if serifs:.55u# else:.75u# fi;
adjust_fit(if serifs: 0,0 else: .4u#,.25u# fi);
numeric theta; theta=90-angle(40u,h); % angle at middle
pickup fine_pen; penpos2(round(.2[vair,fine])-fine,-90);
penpos4(ess-fine,theta); penpos5(ess-fine,theta);
penpos7(round(.1[vair,fine])-fine,-90);
x2+x7=x4+x5=w; x7=x2; x5-x4=1.5u; top y2l=h+round(1.5oo); bot y7r=-oo;
.5[y4,y5]=.52h; z5-z4=whatever*dir(theta-90);
lft x3l=round .6u; rt x6r=round(w-.6u);
y3l=.52[.5[y4l,y5l],y2l]; y6r=.52[.5[y4r,y5r],y7r];
z3r=parallel_pos(.5[vair,ess]-fine,z3l,z2l,z2r);
z6l=parallel_pos(.5[vair,ess]-fine,z6r,z7r,z7l);
numeric tau; tau=max(.8,.20710678/(superness-.5));
filldraw stroke z2e{left}..tension atleast tau..z3e{down}
..tension atleast tau and atleast 1..z4e---z5e
..tension atleast 1 and atleast tau..z6e{down}
..tension atleast tau..z7e{left}; % main stroke
if serifs: penpos1(hair-fine,180); penpos8(hair-fine,180);
rt x1l=round(w-1.05u); lft x8r=round .6u;
bot y1=round 2/3h+1; top y8=round 1/3h-1;
filldraw stroke z1e{up}...{left}z2e; % upper arc
filldraw stroke z7e{left}..z8e; % lower arc
path upper_arc, lower_arc;
upper_arc=z1{up}...{left}z2; lower_arc=z7{left}..z8;
x0=x1l; top y0=h+oo; x9=x8r; bot y9=0;
x1l-x1'=x8'-x8r=curve-tiny; y1'=y1; y8'=y8;
numeric t; t=xpart(upper_arc intersectiontimes(z0..z1'));
filldraw z1l--z0--subpath(t,0) of upper_arc--cycle; % upper barb
t:=xpart(lower_arc intersectiontimes(z9..z8'));
filldraw z8r--z9--subpath(t,1) of lower_arc--cycle; % lower barb
else: penpos1(5/7[vair,flare]-fine,-90); penpos8(flare-fine,-90);
rt x1=round(w-u); lft x8=round .6u;
top y1l=round(.93h+1.5oo); bot y8r=round .1h-oo;
filldraw stroke z1e..tension.9..{left}z2e; % upper arc and terminal
filldraw stroke z7e{left}..z8e; fi % lower arc and terminal
penlabels(0,1,1',2,3,4,5,6,7,8,8',9); endchar;
cmchar "The letter t";
beginchar("t",7u#,min(asc_height#,
x_height# + if notched: 17/30 fi (x_height#-bar_height#)),0);
italcorr x_height#*slant if serifs: -u# else: -.5u# fi;
adjust_fit(0,if serifs: 0 else: -.5u# fi);
numeric shaved_stem,bar_thickness;
shaved_stem=if notched:stem'' else: stem fi;
bar_thickness=if serifs: slab else: vair fi;
pickup fine_pen; penpos2(shaved_stem-fine,180); penpos3(shaved_stem-fine,180);
lft x2r=lft x3r=round(2.5u-.5shaved_stem); y2=y8; y3=.5bar_height;
pickup crisp_pen; penpos8(bar_thickness-crisp,90);
rt x8=round(w-1.5u); top y8r=x_height; lft x7=round 1/3u; y7l=y8l;
if notched: penpos7(bar_thickness-crisp,90);
filldraw stroke z7e..z8e; % crossbar
pickup tiny_pen; penpos1(round(shaved_stem-stem_corr)-tiny,0);
rt x1r=x2l+pen_rt_[fine_pen]; top y1=h;
penpos2'(x1r-x1l,0); x2'=x1; y2'=y2;
filldraw stroke z1e..z2'e; % upper terminal
else: penpos7(vair-crisp,90); penpos1(hair-crisp,0);
rt x1r=x2l+pen_rt_[fine_pen]; top y1=h;
filldraw z1l{down}...{left}z7r--z7l--z8l
--z8r--(x1r,y8r)--z1r--cycle; fi % upper terminal and crossbar
{{interim superness:=more_super; pickup fine_pen;
penpos4(round(vair+hair_corr)-fine,-90); bot y4r=-oo; rt x5r=round(w-u);
if serifs: penpos5(hair-fine,0); y5=y3; x4l=.5[x3l,x5l];
(x,y4r)=whatever[z4l,z5l]; x4r:=x;
filldraw stroke z2e..super_arc.e(3,4)...{up}z5e; % stem and hook
pickup crisp_pen; penpos6(hair-crisp,0); penpos5'(hair-crisp,0);
x6=x5=x5'; top y6=round .75bar_height; y5=y5';
filldraw stroke z5'e..z6e; % terminal
else: penpos5(vair-fine,-75); top y5l=round(.2[top y4l,bar_height]);
x5l:=good x x5l; x4l=1/3[x3l,x5l]; x4r:=1/3[x3r,x5r]; y3l:=y3l+.2vair;
filldraw stroke z2e..super_arc.e(3,4)
..tension .9 and atleast 1..z5e; fi}}; % stem, hook, and terminal
penlabels(1,2,3,4,5,6,7,8); endchar;
cmchar "The letter u";
beginchar("u",10u#,x_height#,0);
italcorr x_height#*slant-serif_fit#+.5stem#-2u#;
adjust_fit(serif_fit#,serif_fit#);
numeric reduced_vair; reduced_vair=vair if notched: -round(2hair_corr) fi;
if reduced_vair<fine_breadth: reduced_vair:=fine_breadth; fi
pickup tiny_pen; penpos1(stem-tiny,0); penpos2(stem-tiny,0);
penpos3(stem-tiny,0); penpos4(stem'-tiny,0);
lft x1l=round(2.5u-.5stem); x1=x2; x3=w-x1; x3r=x4r;
if serifs: top y1=h+min(oo,serif_drop); bot y4=-min(oo,serif_drop);
else: top y1=h; bot y4=0; fi
penpos0(stem-tiny,0); penpos0'(stem'-tiny,0); x0=x3; x0'=x4; y0=y0';
penpos2'(stem-fine,-180); z2'=z2; y3=y1; y2=.5bar_height;
penpos5(reduced_vair-fine,-90); penpos6(2epsilon,0); y6=y0=2/3bar_height;
filldraw stroke z1e..z2e; % left stem
filldraw stroke z3e..z0e--z0'e..z4e; % right stem
pickup fine_pen; bot y5r=-oo; x5l=.5w-.25u; lft x6l=x0l+pen_lft_[tiny_pen];
(x,y5r)=whatever[z5l,z6l]; x5r:=x;
filldraw stroke {{interim superness:=hein_super;
pulled_super_arc.e(2',5)(superpull)}} & z5e{right}...{up}z6e; % arc
if serifs: sloped_serif.l(1,2,a,1/3,jut,serif_drop); % upper left serif
sloped_serif.l(3,0,b,1/3,jut,serif_drop); % upper right serif
sloped_serif.r(4,0',c,1/3,jut,min(oo,serif_drop)); fi % lower right serif
penlabels(1,2,3,4,5); labels(6); endchar;
cmchar "The letter v";
beginchar("v",9.5u#,x_height#,0);
italcorr x_height#*slant+.25u#;
adjust_fit(serif_fit# if monospace:+.5u#,.5u#+ else:,fi serif_fit#);
numeric left_stem,right_stem,outer_jut,notch_height,alpha;
left_stem=fudged.stem;
right_stem=fudged.hair if notched:-2stem_corr fi;
outer_jut=.75jut; x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4=h;
x2-x1=x4-x3; x2l+apex_corr=x3l; y2=y3=-apex_o;
alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
z0=whatever[z1r,z2r]=whatever[z3l,z4l]; notch_height=hair;
if notched and (y0>notch_height): y0:=notch_height;
fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,4r,3r)
--diag_end(4r,3r,2l,1l)--diag_end(2l,1l,1r,2r){z2-z1}
...{down}z0+.5left--cycle; % left and right diagonals
else: fill z0--diag_end(0,4l,4r,3r)--diag_end(4r,3r,2l,1l)
--diag_end(2l,1l,1r,0)--cycle; fi % left and right diagonals
if serifs: numeric inner_jut; pickup tiny_pen;
diag_inside(1,2); diag_inside(4,3);
if rt x1'r+jut+1.5u+2≤lft x4'l-jut: inner_jut=jut;
else: rt x1'r+inner_jut+1.5u+2=lft x4'l-inner_jut; fi
cup_serif(1',2,a,b,1/3,outer_jut,1/2,inner_jut); % left serif
cup_serif(4',3,c,d,.6,inner_jut,1/2,outer_jut)(dark); fi % right serif
penlabels(0,1,2,3,4); endchar;
cmchar "The letter w";
beginchar("w",13u#+width_adj#,x_height#,0);
italcorr x_height#*slant+.25u#;
adjust_fit(serif_fit#,serif_fit#);
numeric stem[],outer_jut,notch_height,alpha;
outer_jut=.7jut; x1l=w-x8r=l+letter_fit+outer_jut+.25u;
stem1=fudged.stem;
stem4=fudged.hair if notched:-2stem_corr fi;
stem2=stem4 if notched:-2stem_corr fi;
stem3=stem1 if notched:-2stem_corr fi;
x2-x1=x4-x3=x6-x5=x8-x7; x2l+apex_corr=x3l; x6l+apex_corr=x7l;
y1=y8=h; y2=y3=y6=y7=-apex_o;
y4=y5=if monospace: round.85 fi h;
alpha=diag_ratio(4,stem2-stem3+stem4,y1-y2,x8r-x1l-2.5apex_corr);
penpos1(alpha*stem1,0); penpos2(alpha*stem1,0);
penpos3(alpha*stem2,0); penpos4(alpha*stem2,0);
penpos5(alpha*stem3,0); penpos6(alpha*stem3,0);
penpos7(alpha*stem4,0); penpos8(alpha*stem4,0);
x4l-x1l=floor(x4l-x1l+.5(x5r-x4r-.5apex_corr));
z23=whatever[z1r,z2r]=whatever[z3l,z4l];
z45=whatever[z3r,z4r]=whatever[z5l,z6l];
z67=whatever[z5r,z6r]=whatever[z7l,z8l];
notch_height=h-hair;
fill diag_end(1l,2l,3r,4r){z4-z3}
...if notched and(y45>notch_height):(x45,notch_height)+.5left{up}
--(x45,notch_height)+.5right{down} else: z45&z45 fi
...{z6-z5}diag_end(5l,6l,7r,8r)--diag_end(7r,8r,8l,7l){z7-z8}
...if notched and(y67<hair):(x67,hair)+.5right{down}
--(x67,hair)+.5left{up} else: z67&z67 fi
...{z5-z6}diag_end(6r,5r,4l,3l){z3-z4}
...if notched and(y23<hair):(x23,hair)+.5right{down}
--(x23,hair)+.5left{up} else: z23&z23 fi
...{z1-z2}diag_end(2r,1r,1l,2l)--cycle; % diagonals
if serifs: numeric inner_jut[]; pickup tiny_pen;
diag_inside(1,2); diag_inside(5,6); diag_inside(8,7);
if monospace or notched: inner_jut1=inner_jut4=jut;
else: fill diag_end(6r,5r,5l,6l)--.5[z5l,z6l]--.5[z5r,z6r]--cycle;% middle stem
inner_jut1=inner_jut2; inner_jut4=1.1inner_jut3;
if rt x1'r+jut+u+2≤lft x5'l-jut: inner_jut1=jut;
else: rt x1'r+inner_jut1+u+2=lft x5'l-inner_jut2; fi
if rt x5'r+jut+u+2≤lft x8'l-1.1jut: inner_jut3=jut;
else: rt x5'r+inner_jut3+u+2=lft x8'l-inner_jut4; fi
cup_serif(5',6,e,f,1/3,inner_jut2,1/2,inner_jut3); fi % middle serif
cup_serif(1',2,a,b,1/3,outer_jut,1/2,inner_jut1); % left serif
cup_serif(8',7,c,d,.6,inner_jut4,1/2,outer_jut)(dark); fi % right serif
penlabels(1,2,3,4,5,6,7,8,23,45,67); endchar;
cmchar "The letter x";
beginchar("x",9.5u#,x_height#,0);
italcorr x_height#*slant-.05u#;
adjust_fit(serif_fit# if monospace:+.5u#,.5u#+ else:,fi serif_fit#);
numeric stem[],outer_jut,xjut,alpha[];
stem1=fudged.stem; stem2=fudged.hair;
outer_jut=.75jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
x1l=l+letter_fit+.1u+outer_jut; x2r=r-letter_fit-.3u-outer_jut-xjut; y1=y2=h;
x3l=l+letter_fit+outer_jut+xjut; x4r=r-letter_fit-outer_jut; y3=y4=0;
alpha1=diag_ratio(1,stem1,h,x4r-x1l);
alpha2=diag_ratio(1,stem2,h,x2r-x3l);
penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0);
penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0);
if notched: z0=whatever[z1,z4]=whatever[z2,z3];
x12=x34=x0; y13=y24=y0;
z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l];
z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r];
fill diag_end(12,1r,1l,13)--z13--diag_end(13,3l,3r,34)--z34
--diag_end(34,4l,4r,24)--z24--diag_end(24,2r,2l,12)--z12--cycle; % diagonals
else: fill diag_end(4r,1r,1l,4l)--diag_end(1l,4l,4r,1r)--cycle; % left diagonal
fill diag_end(2l,3l,3r,2r)--diag_end(3r,2r,2l,3l)--cycle; fi % right diagonal
if serifs: numeric inner_jut[]; pickup tiny_pen;
diag_inside(1,4); diag_inside(2,3); diag_inside(3,2); diag_inside(4,1);
if rt x1'r+jut+u+2≤lft x2'l-jut-xjut: inner_jut1=jut;
else: rt x1'r+inner_jut1+u+2=lft x2'l-inner_jut1-xjut; fi
if rt x3'r+jut+u+2≤lft x4'l-jut-xjut: inner_jut2=jut;
else: rt x3'r+inner_jut2+u+2=lft x4'l-inner_jut2-xjut; fi
cup_serif(1',4,a,b,1/3,outer_jut,2/3,inner_jut1); % upper left serif
cup_serif(4',1,c,d,2/3,inner_jut2,1/3,outer_jut); % lower right serif
cup_serif(2',3,e,f,
2/3,inner_jut1+xjut,1/2,outer_jut+xjut)(dark); % upper right serif
cup_serif(3',2,g,h,
1/2,outer_jut+xjut,2/3,inner_jut2+xjut)(dark); fi % lower left serif
penlabels(0,1,2,3,4,12,13,24,34); endchar;
cmchar "The letter y";
beginchar("y",9.5u#,x_height#,desc_depth#);
italcorr x_height#*slant+.25u#;
adjust_fit(serif_fit# if monospace:+.5u#,.5u#+ else:,fi serif_fit#);
numeric left_stem,right_stem,bot_stem,bot_vair,outer_jut,notch_height;
left_stem=fudged.stem;
right_stem=fudged.hair if notched:-2stem_corr fi;
bot_stem=fudged.hair if notched:-8stem_corr fi;
bot_vair=vround(if serifs: vair else:.5[vair,bot_stem] fi);
outer_jut=.75jut;
x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4r=h; y2=y3=0; x2l=x3l;
numeric alpha,alpha[]; x9=3u; y9=bot_vair-d-oo;
alpha1=diag_ratio(2,bot_stem,y1-y3,x4r-x1l-apex_corr);
alpha2=diag_ratio(1,bot_stem,y1-y9,x4r-x9);
if alpha1<alpha2: x2l-x1l=x4r-x3r+apex_corr; alpha=alpha1;
else: alpha=alpha2; z3l=whatever[z9,z4r-(alpha*bot_stem,0)]; fi
penpos3(alpha*bot_stem,0); penpos4(alpha*right_stem,0);
alpha3=(y1++(x2l-x1l))/y1;
penpos1(alpha3*left_stem,0); penpos2(alpha3*left_stem,0);
z0=whatever[z1r,z2r]=z4l+whatever*(z3r-z4r); notch_height=hair;
if notched and (y0>notch_height): y0:=notch_height;
fill z0+.5right{up}...{z4r-z3r}diag_end(0,4l,4r,3r)
--z3r--z2l--diag_end(2l,1l,1r,2r){z2-z1}
...{down}z0+.5left--cycle; % left and right diagonals
else: fill z0--diag_end(0,4l,4r,3r)--z3r--z2l
--diag_end(2l,1l,1r,0)--cycle; fi % left and right diagonals
penpos5(alpha*bot_stem,0); z5r=whatever[z3r,z4r]; y5-.5vair=-.5d;
if serifs: numeric reduced_bulb; reduced_bulb=7/8[hair,flare]; clearpen;
penpos6(vair,-90); penpos7(hair,-180); penpos8(reduced_bulb,-180);
x6=2u; y6r=-d-oo; y8-.5reduced_bulb=-.85d; x8r=round .35u;
fill stroke z3e---z5e...{left}z6e; bulb(6,7,8); % arc and bulb
numeric inner_jut; pickup tiny_pen;
diag_inside(1,2); diag_inside(4,3);
if rt x1'r+jut+1.5u+2≤lft x4'l-jut: inner_jut=jut;
else: rt x1'r+inner_jut+1.5u+2=lft x4'l-inner_jut; fi
cup_serif(1',2,a,b,1/3,outer_jut,1/2,inner_jut); % left serif
cup_serif(4',3,c,d,.6,inner_jut,1/2,outer_jut)(dark); % right serif
else: penpos6(bot_vair,-90); x6=2.5u; y6r=-d-oo;
fill stroke z3e---z5e...{left}z6e; % arc
pickup fine_pen; penpos6'(bot_vair-fine,-90); z6'=z6;
penpos7(2/3[bot_vair,flare]-fine,-85);
lft x7l=round u; bot y7r=round(-.95d); y7l:=good.y y7l;
filldraw stroke z6'e{left}..z7e; fi % arc and terminal
penlabels(0,1,2,3,4,5,6,7,8); endchar;
cmchar "The letter z";
beginchar("z",8u#,x_height#,0);
italcorr x_height#*slant-.5serif_fit#-.45u#;
adjust_fit(0,.5serif_fit#);
numeric arm_thickness[];
arm_thickness1=round(vair-stem_corr); arm_thickness2=round(vair+2stem_corr);
if arm_thickness1<tiny_breadth: arm_thickness1:=tiny_breadth; fi
pickup tiny_pen; rt x1r=rt x2r=round(w-.95u); lft x3l=lft x4l=round .5u;
top y1=h; bot y2=h-arm_thickness1; top y3=arm_thickness2; bot y4=0;
numeric alpha; alpha=diag_ratio(1,stem-tiny,y2-y3,x2r-x3l);
penpos1(alpha*(stem-tiny),0); penpos2(alpha*(stem-tiny),0);
penpos3(alpha*(stem-tiny),0); penpos4(alpha*(stem-tiny),0);
filldraw stroke z1e--z2e--z3e--z4e; % diagonal
pickup crisp_pen; penpos5(arm_thickness1-crisp,90); penpos6(hair-crisp,180);
top y5r=h; x5=x1; lft x6r=round u; y6=good.y(y5l-beak/1.4);
arm.a(5,6,.6beak_darkness,-.4beak_jut); % upper arm and beak
penpos7(arm_thickness2-crisp,-90); penpos8(hair-crisp,0);
bot y7r=0; x7=x4; rt x8r=round(w-.75u); y8=good.y(y7l+beak/1.2);
arm.b(7,8,.6beak_darkness,.6beak_jut); % lower arm and beak
penlabels(1,2,3,4,5,6,7,8); endchar;